<template>
  <Form ref="form" :model="form" :rules="rules" inline>
    Form
    <br />
    <Form-item prop="user">
      <Input type="text" v-model="form.user" placeholder="Username">
        <Icon type="ios-person-outline" slot="prepend"></Icon>
      </Input>
    </Form-item>
    <Form-item prop="password">
      <Input type="password" v-model="form.password" placeholder="Password">
        <Icon type="ios-locked-outline" slot="prepend"></Icon>
      </Input>
    </Form-item>
    <br />
    <Form-item>
      <Button type="primary">登录</Button>
    </Form-item>
  </Form>
</template>
<script>
export default {
  data() {
    return {
      form: {
        user: '',
        password: '',
      },
      rules: {
        user: [
          {
            required: true,
            message: '请填写用户名',
            trigger: 'blur',
          },
        ],
        password: [
          {
            required: true,
            message: '请填写密码',
            trigger: 'blur',
          },
          {
            type: 'string',
            min: 6,
            message: '密码长度不能小于6位',
            trigger: 'blur',
          },
        ],
      },
    }
  },
}
</script>
